﻿@{
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
}

@model LineOfBusiness.Poco.AD_tblUserAccount

@{Html.LOBHtmlHelper().tdLable("120");}

<style>
 fieldset {
    margin: 8px; 
    border: 1px solid silver;
    padding: 8px;    
    border-radius: 4px;
}
legend{
    padding: 2px;        
}
</style>
 

    <form id="frm">
        <table style="width:100%;padding-left:15px;padding-right:15px">
            <tr>
                <td class="tdLable">
                    @Html.LOBHtmlHelper().Label("lblPassword", "Password")
                </td>
                <td>
                    @Html.LOBHtmlHelper().Input("Password", InputType.Password, 0, "",new { @class = "k-textbox" ,style="width:100%"})
                </td>
            </tr>

            <tr>
                <td >
                    @Html.LOBHtmlHelper().Label("lblConfirmPassword", "Confirm Password")
                </td>
                <td>
                    @Html.LOBHtmlHelper().Input("ConfirmPassword", InputType.Password, 0, "", new { @class = "k-textbox", style="width:100%" })
                </td>
            </tr>

        </table>

        <div id="_blank" style="height:20px">
        </div>
    </form>

<div class="Line"></div>

<div  style="text-align:right">
    <div class="buttons">
        @if(ViewBag.Edit!=-1)
        {
            <button id="btnSave" class="positive" onclick= "UpdatePopup()">
                <img src="@Html.BaseUrl()Content/images/toolbar/save.png" alt="" /> 
                @Html.LOBHtmlHelper().C("Update")
            </button> 
        }
        <button class="positive" onclick= "Close()">
            <img src="@Html.BaseUrl()Content/images/toolbar/close.png" alt="" /> 
            @Html.LOBHtmlHelper().C("Close")
        </button> 
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {
        setTimeout(function () { $("#Password").focus(); }, 500);
     });

    function UpdatePopup() {
        if ($("#ConfirmPassword").val() != $("#Password").val())
        {
            ShowMessageError("PwNotSame", "Please enter right confirm password")
            return;
        }

        var data = PostServer('@Url.Action("UpdateReSetPassword","UserAccount")?UserGroupID=@Model.UserGroupID&Password=' + $("#Password").val())
        if (!IsNull(data.Error) && data.Error!='0')
        {
            ShowMessageError("", data.Error)
            return;
        }

        closeWindow(0, "", idWindow);
    }

    function Close() {
        closeWindow(0, "", idWindow);
    }
</script>